package com.foreknow.demo6;

public class Person {
    private int age;

    public Person(int age) {
        this.age = age;
    }


    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public static void main(String[] args) {
        Person p1 = new Person(20);
        Person p2 = new Person(20);
        System.out.println(p1 == p2); //false
        System.out.println(p1.equals(p2)); //false 原因：是因为我们使用的是Object中的equals，不是String中的equals
    }

}
